﻿using DomainCommons.Models;
using EntityModels.E02.Identities;
using EntityModels.E03.Photographs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModels.E04.Interactions
{
    /// <summary>
    /// 作品评论
    /// </summary>
    public class Comment:BaseEntity<int>
    {
        /// <summary>
        /// 父评论
        /// </summary>
        public int? ParentCommentId { get; set; }
        public Comment ParentComment { get; set; }
        /// <summary>
        /// 子评论集合
        /// </summary>
        public ICollection<Comment> Replies { get; set; }
        /// <summary>
        /// 评论作品
        /// </summary>
        public Photograph Photograph { get; set; }
        public Guid PhotographId { get; set; }
        /// <summary>
        /// 评论用户
        /// </summary>
        public AppUser AppUser { get; set; }
        public Guid AppUserId { get; set; }
        /// <summary>
        /// 评论内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 点赞数量
        /// </summary>
        public int LikeCount { get; set; }

        public void IncreaseLike()
        {
            LikeCount += 1;
        }
        public void ReduceLike()
        {
            LikeCount -= 1;
        }
    }
}
